package main

import (
	"fmt"
	"sort"
)

type day struct {
	num       int
	shortName string
	longName  string
}

type dayArray struct {
	data []*day
}

func (d *dayArray) Len() int           { return len(d.data) }
func (d *dayArray) Less(a, b int) bool { return d.data[a].num < d.data[b].num }
func (d *dayArray) Swap(a, b int)      { d.data[a], d.data[b] = d.data[b], d.data[a] }

func days() {
	Sunday := day{0, "SUN", "Sunday"}
	Monday := day{1, "MON", "Monday"}
	Tuesday := day{2, "TUE", "Tuesday"}
	Wednesday := day{3, "WED", "Wednesday"}
	Tursday := day{4, "TUR", "Tursday"}
	Friday := day{5, "FRI", "Friday"}
	Saturday := day{6, "SAT", "Saturday"}
	data := []*day{&Monday, &Tuesday, &Tursday, &Sunday, &Friday, &Saturday, &Wednesday}

	arr := dayArray{data}

	sort.Sort(&arr)

	if !sort.IsSorted(&arr) {
		panic(fmt.Sprintf("fail to sort arr: %v", arr))
	}
	for _, d := range data {
		fmt.Printf("%s ", d.longName)
	}
	fmt.Printf("\n")
}

func main() {
	days()
}
